package vn.conghuy.talkwithme.responsor.action;

import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;

import android.content.Context;
import android.content.Intent;

public class CalendarAction extends Action {

	public CalendarAction(Context context) {
		super(context);
	}
	
	public void createAppointment(String content, Date date){
		Intent nativeIntent = new Intent(Intent.ACTION_EDIT);
		nativeIntent.setType("vnd.android.cursor.item/event");

		Calendar cal = Calendar.getInstance();
		cal.setTime(date);


		nativeIntent.putExtra("beginTime", cal.getTimeInMillis());
		nativeIntent.putExtra("endTime", cal.getTimeInMillis()+3600000);
		nativeIntent.putExtra("title", content);

		context.startActivity(nativeIntent);
	}
	
}
